#include <iostream>
using namespace std;
class Student
{
    public:
       string name;
       Student(string pname)
       {
           name = pname;
       }
       void intro()
       {
           cout<< "Hi,I am "<<name<<endl;
       }
        virtual void showGrade()
        {
            cout<<"No elective course "<<endl;
        }
};
class MStudent : public Student
{
   public:
      int boxGrade;
      MStudent(string pname, int pBoxGrade) : Student(pname)
      {
          boxGrade = pBoxGrade;
      }
      void showGrade()
      {
          cout<<"My boxGrade "<<boxGrade<<endl;
      }
};
class FStudent: public Student
{
    public:
        int gymGrade;
        FStudent(string pname, int pGymGrade) : Student(pname)
        {
            gymGrade = pGymGrade;
        }
        void showGrade()
        {
            cout<< "My gymGrade "<< gymGrade << endl;
        }
};

int main()
{
    Student s("Zhangsan");
    s.intro();
    s.showGrade();
    MStudent ms("lisi",90);
    ms.intro();
    ms.showGrade();
    FStudent fs("wangwu",80);
    fs.intro();
    fs.showGrade();

    /*
    Student s1 = ms;
    s1.intro();
    s1.showGrade();
    */
    /*   
    Student * s1 = &ms1;
    s1->intro();
    s1->showGrade();
    */
    /*
    Student& s1 = ms1;
    s1.intro();
    s1.showGrade();
    */
    Student * sa[3] ={&s,&ms,&fs};
    for(int i = 0; i<3; i++)
        sa[i]->showGrade();
}